ethnic_diversities_of_argentinafandomcom-20200215-history
Help:Magic words
Magic words (including parser functions, variables and behavior switches) are features of that give instructions to Wikipedia's underlying MediaWiki software. For example, magic words can suppress or position the table of contents, disable indexing by external search engines, and produce output dynamically based on the current page or on user-defined conditional logic. Some of these features are especially useful for templates. This page is a quick reference for magic words. For more information, refer to the main MediaWiki documentation: * mw:Help:Magic words: All standard magic words, including the "standard" parser functions. * mw:Help:Extension:ParserFunctions: Additional parser functions, including conditional expressions. General information In general, there are three types of magic words # Behavior switches: often appear in double underscores, all uppercase, e.g., . They will change the behavior of a page, rather than return a value. # Parser functions: all in lowercase. A parser function will be followed by colon and pipe-separated parameters, e.g., , wrapped in double braces. They will take a value and return a value. # Variables: these are all uppercase, e.g., . A variable will be wrapped in double braces and will return a value in its place. The software generally interprets magic words in the following way. * Magic words are case sensitive. * White space is generously allowed for readability. It will be stripped from the start and end of their keywords and parameters (as is also done inside templates). * They can be transcluded, even variables "about the current page". This is ensured by the parsing order. * Instead of magically transforming into HTML instructions, tags remove this magic so a magic word can itself be displayed (documented), e.g. or . Magic words compared to templates: * As with templates, magic words can be transcluded and . * The names of magic words are purposely chosen to be unlike the names of templates, and vice versa. Many parser function names will begin with a # (pound), but template names will not start with a #, and probably not end in a : (colon), or be all-uppercase. * The first parameter's syntax differs. In , the name is #magic and it is followed by an unspaced : and a required input parameter, p1. With a template, p1 is optional and it is preceded by a | (pipe) instead of a :, e.g. . Behavior switches Variables Note: The magic words above can also take a parameter, in order to parse values on a page other than the current page. A colon ( :''' ) is used to pass the parameter, rather than a pipe ( |' ) that is used in templates, like . For example, returns Wikipedia talk:MOS on any page. See meta:Help:Page name for more details of parser functions. ''Note: In the "Category" and "Category talk" namespaces, to wikilink (some) page name variables may require prefixing a colon to avoid unwanted categorization. Other variables by type | * * * * * * * | * * * * * * * |} : cannot be substituted and does not function in preview. : English Wikipedia. : This shows the last user to edit the page. There is no way to show the user viewing the page due to technical restrictions. Parser functions Metadata To output numbers without comma separators (for example, as "123456789" rather than "123,456,789"), append the parameter |R. Formatting Paths Conditional If, in these conditional functions, empty unnamed parameters are to be parsed as empty rather than as text (i.e. as empty rather than as the text " }", " }", etc.), they will require trailing pipes (i.e. 1 , 2 , etc., rather than 1 , 2 , etc.). * For the use of these functions in tables, see Wikipedia:Conditional tables. Other See also * for ISBN, PMID and RFC (all deprecated) * mw:Localisation * mw:Manual:Extending wiki markup * CoreParserFunctions.php * wikEd, a MediaWiki editor with syntax highlighting for templates and parser functions * * * , at the bottom of the page, all the on this page are listed there as Parser function hooks * , works with the expression while allowing redirects to be identified and parsed differently Category:Wikipedia features